/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Transformers;

/**
 *
 * @author Gebruiker
 */
public class TimeSeries {
    public static double[] center(double[] data){
        double avg = 0;
        //Center the data.
        for(int i = 0; i < data.length; i++){
            avg += data[i];
        }
        avg /= data.length;

        for(int i = 0; i < data.length; i++){
            data[i] = data[i] - avg;
        }

        return data;
    }

    public static double[] scale(double[] data, double k){
        for(int i = 0; i < data.length; i++){
            data[i] = data[i]*k;
        }
        return data;
    }
}
